package bookstore;

import java.sql.SQLException;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;

public class InitializationPlugIn implements PlugIn {

    public void destroy() {
    }

    public void init(ActionServlet servlet, ModuleConfig config)
            throws ServletException {
        ServletContext context = servlet.getServletContext();
        try {
            new BookManager().init(context);
            System.out.println("Debug->Plugin.init()");
        } catch (SQLException e) {
            context.log(e.getMessage());
        }
    }

}
